home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / vbcc / doc / vbcc.doc < prev    next >
Text File  |  1995-11-23  |  6KB  |  198 lines

  1. vbcc - C compiler (c) in 1995 by Volker Barthelmann
  2.  
  3.  
  4. INTRODUCTION
  5.  
  6.     vbcc shall be a free portable ANSI compliant C compiler.
  7.     It is clearly split into a machine independant and a machine dependant
  8.     part and supports emulating datatypes of the target machine on any
  9.     other machine so that it is possible to e.g. make a crosscompiler for
  10.     a 64bit machine on a 32bit machine.
  11.  
  12.     The machine independant part generates a form of intermediate code
  13.     (quads) which has to be dealt with by the code generator. This
  14.     intermediate code is rather cpu independant (apart from register usage),
  15.     but the machine independant part of vbcc uses informations about the
  16.     target machine while generating this code.
  17.  
  18.     If You are interested in writing a code generator for vbcc, contact
  19.     me (the necessary documents are not written yet).
  20.  
  21.     This document only deals with the machine independant parts of vbcc.
  22.     Be sure to read all the documents in the doc directory for Your machine.
  23.  
  24.  
  25. LEGAL
  26.  
  27.     vbcc is (c) in 1995 by Volker Barthelmann. All code is written by me
  28.     and may be freely redistributed as long as no modifications are made
  29.     and nothing is charged for it.
  30.     Non-commercial usage of vbcc is allowed without any restrictions.
  31.     Commercial usage needs my written consent.
  32.  
  33.     Sending me money, gifts, postcards etc. would of course be very nice
  34.     and may encourage further development of vbcc, but is not legally or
  35.     morally necessary to use vbcc.
  36.  
  37.  
  38. INSTALLATION
  39.  
  40.     The installation is system dependant and covered in another manual.
  41.  
  42.  
  43. USAGE
  44.  
  45.     Usually vbcc will be called by a frontend. However if You call it
  46.     directly, it has to be done like this (and most of the options
  47.     will be passed through to vbcc by the frontend).
  48.  
  49.     vbcc [options] file
  50.  
  51.     At the moment file has to be an already preprocessed C source.
  52.  
  53.     The following options are supported by the machine independant part
  54.     of vbcc:
  55.  
  56.     -quiet      do not print the copyright notice
  57.  
  58.     -ic1        write the intermediate code before optimizing to file.ic1
  59.  
  60.     -ic2        write the intermediate code after optimizing to file.ic2
  61.  
  62.     -debug=n    set the debug level to n
  63.  
  64.     -noasm      do not generate assembler output for code (only for testing)
  65.  
  66.     -O=n        turns optimizing options on/off; every bit set in n turns
  67.                 on an option; see below
  68.  
  69.     -ansi       switch to ANSI mode;
  70.                 at the moment this only affects warning/error messages;
  71.                 in ANSI mode every warning with ANSI violation will be an
  72.                 error and all other warnings are suppressed.
  73.  
  74.     -maxerrors=n
  75.                 abort the compilation after n errors; do not stop if n==0
  76.  
  77.     -dontwarn=n
  78.                 suppress warning number n
  79.  
  80.  
  81.     The assembler output will be saved to file.asm (if file already contained
  82.     a suffix, this will first be removed; same applies to .ic1/.ic2)
  83.  
  84.  
  85. SOME INTERNALS
  86.  
  87.     I try to make vbcc as ANSI compliant as possible (but this is not that
  88.     easy, because I do not have the ANSI document), so I am only mentioning
  89.     some things I consider interesting.
  90.  
  91.     First, there still may be many many bugs, the compiler may crash, it may
  92.     generate incorrect code, accept incorrect sources etc. Also it does
  93.     almost no optimizing at the moment and is still very slow.
  94.  
  95. DATA TYPES
  96.  
  97.     vbcc can handle the following data types:
  98.  
  99.     signed/unsigned char/short/int/long  (signed is always default)
  100.     float/double  (long double is always the same as double)
  101.     However several of them can be identical in certain implementations.
  102.  
  103. OPTIMIZATIONS
  104.  
  105.     At the moment the following bits in the -O option are recognized:
  106.  
  107.     Bit 0 (1)
  108.  
  109.     Use simple register allocation to assign variables to registers.
  110.     This improves the generated code quite a bit.
  111.     The effect on compile time is hard to predict, but it should be very
  112.     small - this optimization may even speed up the compilation.
  113.  
  114.     Other Bits may be recognized by the machine dependant part of vbcc.
  115.  
  116.  
  117. KNOWN PROBLEMS
  118.  
  119.     Some known machine independant problems of vbcc at the moment:
  120.  
  121.     - Some size limits are still hardcoded into the source.
  122.  
  123.     - Switch statements are not optimized.
  124.  
  125.     - Bitfields are not supported (they are always used as int) - this should
  126.       be ANSI compliant, however.
  127.  
  128.     - No own preprocessor and some problems connected with this. E.g. in
  129.       error messages the name and line number of the preprocessor output
  130.       will be printed rather than the original source. Also there are
  131.       some cases where You cannot format Your source as freely as possible.
  132.       However You probably have rather strange style if You encounter this
  133.       problem.
  134.  
  135.     - Inefficient source.
  136.  
  137.     - The source is not strictly ANSI conforming (i.e. fully portable), yet.
  138.       E.g. there may be some external identifiers with more than 6
  139.       identical characters (haven't checked yet) and other problems.
  140.  
  141.     - return of structures passes a pointer to a static object; I am not
  142.       sure if this is sufficient - this will probably be changed to pass
  143.       the address of the destination as a function argument.
  144.  
  145.     - The scope of function parameters may be incorrect (will probably
  146.       only occur if struct/union/enum tags are defined within a prototype).
  147.  
  148.     - Code for accessing volatile objects may not be generated if the result
  149.       is not used.
  150.  
  151.     - Certain kinds of incorrect source may result in an infinite loop of
  152.       error printing or worse problems - some errors will probably have to
  153.       be changed to abort the translation.
  154.  
  155.  
  156. THE FUTURE
  157.  
  158.     - Bugfixing
  159.  
  160.     - Builtin preprocessor. Someone is already working on this.
  161.  
  162.     - Implementing an optimizer. This will be a rather large thing to do
  163.       and I will not start before vbcc seems stable.
  164.  
  165.     - Certain features like register parameters.
  166.  
  167.     - Other code generators.
  168.  
  169.     - If You have any other ideas, tell me.
  170.  
  171.  
  172.  
  173. CREDITS (in descending alphabetical order, under work, not complete)
  174.  
  175.     Frank Wille
  176.     Markus Schmidinger
  177.     Thorsten Schaaps
  178.     Joerg Plate
  179.     Joern Maass
  180.     Kai Kohlmorgen
  181.     Dirk Holtwick
  182.     Volker Graf
  183.     Matthias Fleischer
  184.     Thomas Dorn
  185.     Walter Doerwald
  186.     Lars Dannenberg
  187.     Michael Bode
  188.     Michael Bauer
  189.     Juergen Barthelmann
  190.     Thomas Arnhold
  191.  
  192.  
  193. Volker Barthelmann                                      volker@vb.franken.de
  194. Kennedy-Ring 39
  195. 91301 Forchheim
  196. Germany
  197.  
  198.